package com.example.appointment.fragment;

import android.content.Intent;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;

import com.example.appointment.R;
import com.example.appointment.activity.EditUserInfoActivity;
import com.example.appointment.activity.FeedBackActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Admin on 2016/8/31.
 */
public class UserCenterFragment extends BaseFragment {
    @Bind(R.id.fragment_usercenter_editoruserinfo)
    Button userinfobtn;

    @Override
    protected void initView() {
        userinfobtn.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                switch (event.getAction()) {
                    case MotionEvent.ACTION_DOWN:
                        userinfobtn.setTextColor(0x66ffffff);
                        break;

                    case MotionEvent.ACTION_MOVE:
//                        userinfobtn.setTextColor(0xffffffff);
                        break;
                    case MotionEvent.ACTION_UP:
                        userinfobtn.setTextColor(0xffffffff);
                        break;
                }
                return false;
            }
        });
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_usercenter;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }

    /**
     * 跳转到修改用户属性的界面
     */
    @OnClick(R.id.fragment_usercenter_editoruserinfo)
    public void toedituserinfo() {
        getActivity().startActivity(new Intent(getActivity(), EditUserInfoActivity.class));
    }

    /**
     * 跳转到意见反馈的界面
     */
    @OnClick(R.id.fragment_usercenter_feedback)
    public void tofeedback() {
        getActivity().startActivity(new Intent(getActivity(), FeedBackActivity.class));
    }
}
